import request from '@/utils/request'

// 查询栏目列表
export function listContext(query) {
  return request({
    url: '/fetv/context/list',
    method: 'get',
    params: query
  })
}

// 查询栏目列表分层
export function listContextPrimary(query) {
  return request({
    url: '/fetv/context/list/primary',
    method: 'get',
    params: query
  })
}

// 查询栏目详细
export function getContext(id) {
  return request({
    url: '/fetv/context/' + id,
    method: 'get'
  })
}

// 新增栏目
export function addContext(data) {
  return request({
    url: '/fetv/context',
    method: 'post',
    data: data
  })
}

// 修改栏目
export function updateContext(data) {
  return request({
    url: '/fetv/context',
    method: 'put',
    data: data
  })
}

// 删除栏目
export function delContext(id) {
  return request({
    url: '/fetv/context/' + id,
    method: 'delete'
  })
}

// 获得标签
export function getLabel(query) {
  return request({
    url: '/fetv/context/label/',
    params: {
      query: query
    },
    method: 'get'
  })
}

//获得名字
export function getContextNameById(id) {
  return request({
    url: '/fetv/context/name/' + id,
    method: "get"
  })
}
